package com.apes.enquiry.enquiry.repository;

import com.apes.enquiry.enquiry.model.Enquiry;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

/**
 * 类描述：
 *
 * @ClassName EnquiryRepository
 * @Description 描述
 * @Author wushilong
 * @Date 2023/3/20 11:53
 * @Version 1.0
 */
public interface EnquiryRepository extends CustomRepository<Enquiry, String> {

    @Query(value = "SELECT T.* FROM sp_mas_enquiry T WHERE T.store=:dept AND T.vin=:vin AND T.QUOTE_EXPIRE_DATE >= SYSDATE",nativeQuery = true)
    List<Enquiry> findByServicePlanId(@Param("dept")String dept,@Param("vin")String vin);

    @Query(value = "select a from Enquiry a where a.state = :state")
    List<Enquiry> findAllState(String state);



}
